#include <iostream>
#include <queue>

using namespace std;

typedef long long LL;

int n, k;
priority_queue<int> heap; // 默认就是大根堆

int main()
{
    cin >> n >> k;
    LL sum = 0; // 标记所有元素的和
    
    for(int i = 1; i <= n; i++)
    {
        int x; cin >> x;
        sum += x;
        if(x % 2 == 0) heap.push(x);
    }
    
    while(heap.size() && k--)
    {
        int t = heap.top() / 2;
        heap.pop();
        
        sum -= t;
        if(t % 2 == 0) heap.push(t);
    }
    
    cout << sum << endl;
    
    return 0;
}